package com.forlgb.powercloud.base.client.source.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.forlgb.powercloud.base.client.source.entity.SysRole;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author lyk
 * @since 2021-05-28
 */
public interface SysRoleMapper extends BaseMapper<SysRole> {

    @Select("select a.id,a.name from sys_role a left join sys_user_role b on a.id=b.role_id where b.user_id = ${userId}")
    List<SysRole> getSysRolesByUserId(@Param("userId") Integer userId);
}
